package entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import java.util.List;

@Entity
public class RawMaterialPurchaseOrder implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private Timestamp deliveryDate;
    private String remark;
    @OneToOne(cascade = {CascadeType.PERSIST})
    private Employee employee;
    @ManyToOne(cascade = {CascadeType.PERSIST})
    private Supplier supplier;
    @OneToMany(cascade = {CascadeType.PERSIST})
    private List<MaterialRequirementPlan> materialRequirementPlans;
    private Double amountToPay;
    private String status;

    /* Additional fields to be added*/
    /* /Additional fields to be added*/
    public RawMaterialPurchaseOrder() {
    }

    public RawMaterialPurchaseOrder(Timestamp deliveryDate, String remark, Employee employee, Supplier supplier, 
            List<MaterialRequirementPlan> materialRequirementPlans, Double amountToPay) {
        this.deliveryDate = deliveryDate;
        this.remark = remark;
        this.employee = employee;
        this.supplier = supplier;
        this.materialRequirementPlans = materialRequirementPlans;
        this.amountToPay = amountToPay;
        this.status = "Unpaid";
    }

    /**
     * @return the poId
     */
    public Long getId() {
        return id;
    }

    /**
     * @param poId the poId to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the deliveryDate
     */
    public Timestamp getDeliveryDate() {
        return deliveryDate;
    }

    /**
     * @param deliveryDate the deliveryDate to set
     */
    public void setDeliveryDate(Timestamp deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    /**
     * @return the remark
     */
    public String getRemark() {
        return remark;
    }

    /**
     * @param remark the remark to set
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * @return the employee
     */
    public Employee getEmployee() {
        return employee;
    }

    /**
     * @param employee the employee to set
     */
    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    /**
     * @return the supplier
     */
    public Supplier getSupplier() {
        return supplier;
    }

    /**
     * @param supplier the supplier to set
     */
    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    /**
     * @return the materialRequirementPlans
     */
    public List<MaterialRequirementPlan> getMaterialRequirementPlans() {
        return materialRequirementPlans;
    }

    /**
     * @param materialRequirementPlans the materialRequirementPlans to set
     */
    public void setMaterialRequirementPlans(List<MaterialRequirementPlan> materialRequirementPlans) {
        this.materialRequirementPlans = materialRequirementPlans;
    }

    /**
     * @return the amountToPay
     */
    public Double getAmountToPay() {
        return amountToPay;
    }

    /**
     * @param amountToPay the amountToPay to set
     */
    public void setAmountToPay(Double amountToPay) {
        this.amountToPay = amountToPay;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }
}
